<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no, email=no">
    <meta name="HandheldFriendly" content="true">
    <link rel="stylesheet" href="https://i.gtimg.cn/vipstyle/frozenui/2.0.0/css/frozen.css">
    <script type="text/javascript" src="js/lib/jsencrypt.js"></script>
    <script type="text/javascript" src="js/lib/jsencrypt.min.js"></script>
    <script type="text/javascript" src="js/lib/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="js/lib/md5.min.js"></script>
    <script type="text/javascript" src="js/jsqrcode/grid.js"></script>
    <script type="text/javascript" src="js/jsqrcode/version.js"></script>
    <script type="text/javascript" src="js/jsqrcode/detector.js"></script>
    <script type="text/javascript" src="js/jsqrcode/formatinf.js"></script>
    <script type="text/javascript" src="js/jsqrcode/errorlevel.js"></script>
    <script type="text/javascript" src="js/jsqrcode/bitmat.js"></script>
    <script type="text/javascript" src="js/jsqrcode/datablock.js"></script>
    <script type="text/javascript" src="js/jsqrcode/bmparser.js"></script>
    <script type="text/javascript" src="js/jsqrcode/datamask.js"></script>
    <script type="text/javascript" src="js/jsqrcode/rsdecoder.js"></script>
    <script type="text/javascript" src="js/jsqrcode/gf256poly.js"></script>
    <script type="text/javascript" src="js/jsqrcode/gf256.js"></script>
    <script type="text/javascript" src="js/jsqrcode/decoder.js"></script>
    <script type="text/javascript" src="js/jsqrcode/qrcode.js"></script>
    <script type="text/javascript" src="js/jsqrcode/findpat.js"></script>
    <script type="text/javascript" src="js/jsqrcode/alignpat.js"></script>
    <script type="text/javascript" src="js/jsqrcode/databr.js"></script>
    <script type="text/javascript" src="js/Scan/scan_init.js"></script>
    <script type="text/javascript" src="js/Scan/scan_handleFiles.js"></script>
    <script type="text/javascript" src="js/Scan/scan_dathandle.js"></script>
    <script type="text/javascript" src="js/Scan/scan_pagehandle.js"></script>
    <style>
        .icon-alert
        {
            width: 65% !important;
            margin: 0 auto;
        }
    </style>
    <title>iQRGenuine-扫码验证</title>
</head>
<body>
<div style="max-width: 575px;margin:0 auto;background-color: #fff">
    <div id="comp-main">
        <p class="title" style="text-align: center;font-size:50px">
            iQRGenuine
        </p>
        <div class="ui-dialog" id="dialog1">
            <div class="ui-dialog-cnt">
                <div class="ui-dialog-bd">
                    <h3>扫描到以下信息</h3>
                    <p id="cdkey" style="text-align: left">产品序列号：</p>
                    <p id="information" style="text-align: left">产品信息：</p>
                    <p style="text-align: left">验证只有一次机会，确认继续？</p>
                </div>
                <div class="ui-dialog-ft">
                    <button id="ver" type="button" data-role="button">确认</button>
                    <button id="back" type="button" data-role="button">取消</button>
                </div>
            </div>
        </div>
        <div class="ui-dialog" id="dialog2">
            <div class="ui-dialog-cnt">
                <div class="ui-dialog-bd">
                    <h3>QR Information</h3>
                    <p id="result" style="text-align: left">Error:</p>
                </div>
                <div class="ui-dialog-ft">
                    <button id="ok" type="button" data-role="button">返回</button>
                </div>
            </div>
        </div>
        <br><br><br><br><br>
        <div class="demo">
            <input id="btn_file" type="file" style="display:none" onchange="handleFiles(this.files)">
            <div class="ui-btn-wrap">
                <button class="ui-btn-lg-nowhole ui-btn-primary" onclick="initCam()">
                    拍照
                </button>
            </div>
            <div class="ui-btn-wrap">
                <button class="ui-btn-lg-nowhole ui-btn-primary" id="verify">
                    从相册选择二维码
                </button>
            </div>
            <div class="ui-btn-wrap">
                <a class="ui-btn-lg-nowhole ui-btn-primary" href="login.html">
                    去生成二维码
                </a>
            </div>
        </div>
        <br><br><br><br>
    </div>

    <div id="comp-camera" style="display: none;">
        <section class="ui-panel ui-panel-center ui-border-tb">
            <h2 class="ui-arrowlink">
                <span>请对准防伪二维码</span>
                <span class="ui-panel-title-tips" onclick="goBack()">返回</span>
            </h2>
        </section>
        <div style="width: 50%;height: auto;margin: 0 auto;">
            <canvas id="canvas" width="400" height="400" style="width: 100%;height: auto"></canvas>
        </div>
        <br>
        <video id="video" autoplay style="width:100%; height:auto; object-fit: contain"></video>
        <br><br>
        <div class="ui-feeds">
            <ul>
                <li>
                    <img src="img/shexiangtou.svg" onclick="switch_cam()" id="cam-icon"
                         style="width: 20%;margin: 0 auto">
                </li>
            </ul>
        </div>
        <br>
    </div>

    <div id="comp-yes" style="display: none">
        <section class="ui-panel ui-panel-center ui-border-tb">
            <h2 class="ui-arrowlink">
                <span>验证结果</span>
            </h2>
        </section>
        <div class="ui-feeds">
            <ul>
                <li>
                    <img src="img/duigou.svg" class="icon-alert">
                </li>
            </ul>
        </div>
        <div class="ui-whitespace" style="text-align: center">
            <br><br><br>
            <h2>在线验证通过，请比对您的产品信息：</h2>
            <div id="info">yes</div>
            <div class="ui-notice-btn">
                <button class="ui-btn-primary ui-btn-lg" onclick="goBack()">返回</button>
            </div>
        </div>
    </div>

    <div id="comp-no" style="display: none">
        <section class="ui-panel ui-panel-center ui-border-tb">
            <h2 class="ui-arrowlink">
                <span>验证结果</span>
            </h2>
        </section>
        <div class="ui-feeds">
            <ul>
                <li>
                    <img src="img/tishishuoming.svg" class="icon-alert">
                </li>
            </ul>
        </div>
        <div class="ui-whitespace" style="text-align: center">
            <br><br><br>
            <h2>在线验证未通过，您可能购买了假冒伪劣产品，请联系销售商。</h2>
            <br><br><br><br>
        </div>
        <div class="ui-notice-btn">
            <button class="ui-btn-primary ui-btn-lg" onclick="goBack()">返回</button>
        </div>
    </div>
</div>
</body>
</html>